export * from './toDisplayString'

export const extend = Object.assign;

export const EMPTY_OBJ = {}

export const isObject = (obj) => {
    return obj !== null && typeof obj === 'object'
}
export const isString = (value) => typeof value === 'string'
export const hasChanged = (val,newVal) => {
    // 两个不一样时，返回true
    return !Object.is(val,newVal)
}
export const hasOwn = (val,key) => val.hasOwnProperty(key)

// 支持用户可以传入烤肉串的标识
export const camelize = (str:string) => {
    return str.replace(/-(\w)/g,(_,c:string) => {
        return c ? c.toUpperCase() : '';
    })
}
const capitalize = (str:string) => {
    return str.charAt(0).toUpperCase() + str.slice(1)
}
export const toHandlerKey = (str:string) => {
    return str ? 'on' + capitalize(str) : ''
}